/**
 * Copyright (C) 2012 Foxit Corporation.
 * All Rights Reserved.
 *
 * The following code is copyrighted and contains proprietary information and trade secrets of Foxit Corporation.<br> 
 * You can only redistribute files listed below to customers of your application, under a written SDK license agreement with Foxit.<br>
 * You cannot distribute any part of the SDK to general public, even with a SDK license agreement.<br>
 * Without SDK license agreement, you cannot redistribute anything.
 * 
 * @file    ffdfdocument.h
 * @brief 	Header file for FDF module.
 * @details	This module offers:
 *			1. Load an existing FDF file or create a new FDF document.<br>
 *			2. Get annotations from FDF document and retrieve their data.<br>
 *			3. Export annotations into a FDF document or import annotation objects into PDF document.<br>
 * @note	If you want to purchase Foxit PDF SDK license and use ANY of the following functions,<br>
 *			please request for enabling Annotation module explicitly. 
 */
 
 /** 
 * @addtogroup FGSFDFDOCUMENT FDF Document
 * @brief Methods in this module are included in ffdfdocument.h.
 */
 
 /** @{*/

#ifndef __FGSFDFDOCUMENT__
#define __FGSFDFDOCUMENT__

#include "fpdfbase.h"

#ifdef __cplusplus
extern "C" {
#endif


/**
 * @brief	Load a FDF document.
 *
 * @param[in] streamIn			Reference to an input file stream.
 *								This reference must be kept valid as long as the document is open.		
 *
 * @return	Reference to FGSFDFDocumentRef object that receives the loaded document.
 */
FGSFDFDocumentRef FGSFDFDocLoad(FGSFileStreamInRef streamIn);

/**
 * @brief	Create a FDF document.
 *
 * @return	Reference to FGSFDFDocumentRef object that receives the loaded document.
 *			
 */
FGSFDFDocumentRef FGSFDFDocCreate();
    
/**
 * @brief	Save a FDF document
 *
 * @param[in] fdfDoc			Reference to a FDF document.
 * @param[in] filewrite			Reference to an output file stream.
 *
 * @return	::kFGSErrorSuccess means saving successfully.<br>
 *			For more definitions please see enum definitions <b>FGSErrorRet</b>.
 */
FGSErrorRet FGSFDFDocSave(FGSFDFDocumentRef fdfDoc, FGSFileStreamOutRef streamOut);

/**
 * @brief	Close a FDF document
 *
 * @param[in] fdfDoc			Reference to a FDF document.
 *
 * @return	::kFGSErrorSuccess means closing successfully.<br>
 *			For more definitions please see enum definitions <b>FGSErrorRet</b>.
 *
 */
FGSErrorRet FGSFDFDocClose(FGSFDFDocumentRef fdfDoc);

/**
 * @brief	Get the count of the annots in a FDF document.
 *
 * @param[in] fdfDoc			Reference to a FDF document.
 *
 * @return The count of annotations.
 *
 */
SInt32 FGSFDFDocCountAnnot(FGSFDFDocumentRef fdfDoc);
    
/**
 * @brief	Export annots of a document to a FDF file.
 *
 * @param[in] fdfDoc			Reference to a FDF document.
 * @param[in] index				The zero-based annotation index.
 *
 * @return	The annotation reference.This annot can only be used in 
 *			fucntion <b>FPDF_Annot_GetInfo</b>.
 *
 */
FGSPDFAnnotRef FGSFDFDocGetAnnot(FGSFDFDocumentRef fdfDoc, SInt32 index);
    

/**
 * @brief	Get the page index of a annotation which is get from FDF file.
 *
 * @param[in] fdfAnnot			Reference to a PDF annotation.This reference must be returned by <b>::FGSFDFDocGetAnnot</b>.		
 *
 * @return	The page index num.
 *
 */
SInt32 FGSFDFAnnotGetPageNum(FGSPDFAnnotRef fdfAnnot); 
    

/**
 * @brief	Export annots of a document to a FDF file.
 *
 * @param[in] pdfAnnot			Reference to a PDF annotation.
 * @param[in] fdfDoc			Reference to a FDF document.
 *
 * @return	::kFGSErrorSuccess means exporting successfully.<br>
 *			For more definitions please see enum definitions <b>FGSErrorRet</b>.
 *
 */
FGSErrorRet FGSFDFAnnotExport(FGSPDFAnnotRef pdfAnnot, FGSFDFDocumentRef fdfDoc);

/**
 * @brief	Import annots of a document from a FDF file.
 *
 * @param[in] fdfAnnot			Reference to a PDF annotation.
 * @param[in] pdfDoc			Reference to a PDF document.
 *
 * @return	The zero-based annotation index.
 *
 */
SInt32 FGSFDFAnnotImport(FGSPDFAnnotRef fdfAnnot, FGSPDFDocumentRef pdfDoc);
    
#ifdef __cplusplus
};
#endif

#endif // __FGSFDFDOCUMENT__
/**@}*/

